import { _decorator, Component, Label, LabelComponent, Node } from 'cc'
import { GameManager } from '../GameManager'
const { ccclass, property } = _decorator

@ccclass('ScoreUI')
export class ScoreUI extends Component {
  @property(Label)
  countLable: Label = null

  start() {
    GameManager.getInstance().node.on('onScoreChange', this.updateUI, this)
  }

  updateUI(count: number) {
    this.countLable.string = count.toString()
  }
}
